<nav class="sidebar sidebar-offcanvas" id="sidebar">
    <ul class="nav">
        <li class="nav-item nav-profile">
            <div class="nav-link">
                <div >
                    <!--<div class="profile-image">
                        <img src="/static/star_admin/images/faces/face1.jpg" alt="profile image">
                    </div>-->
                    <div class="text-wrapper">
                        <!--<p class="profile-name">Richard V.Welsh</p>-->
                        <div>
                            <small class="designation text-muted">Manager</small>
                            <span class="status-indicator online"></span>
                        </div>
                    </div>
                </div>
            </div>
        </li>

<!--permission menu start-->
        {php}
        $i = 1;
        foreach ($menu_list as $list) {
            echo "<li class='nav-item'>";
            if ($list['type'] == 1) {
                $level_one_id = 'level_one_' . $i;
                echo "<a class='nav-link' data-toggle='collapse' href='#" . $level_one_id  . "' aria-expanded='false' aria-controls= " . $level_one_id  . ">";
                if ($list['icon_class']) {
                    echo "<i class='menu-icon mdi" . $list['icon_class'] . "'></i>";
                } else {
                    echo "<i class='menu-icon mdi mdi-ya-gen-mei-you'></i>";
                }
                echo "<span class='menu-title'>" . $list['title'] . "</span>";
                echo "<i class='menu-arrow'></i>";
                echo "</a>";
                if (isset($list['child']) && !empty($list['child'])) {
                    echo "<div class='collapse' id='" . $level_one_id . "'>";
                    echo "<ul class='nav flex-column sub-menu'>";
                    foreach ($list['child'] as $item) {
                        echo "<li class='nav-item'>";
                        echo "<a class='nav-link menu-page' href='###' page='" . url($item['route']) . "'>" . $item['title'] . "</a>";
                        echo "</li>";
                    }
                    echo "</ul>";
                    echo "</div>";
                }
            } else {
                echo "<a class='nav-link menu_page' href='###' page='" . url($list['route']) . "' >";
            }
            echo "</li>";
            $i++;
        }
        {/php}
        <li class="nav-item">
            <a class="nav-link" data-toggle="collapse" href="#ui-basic" aria-expanded="false" aria-controls="ui-basic">
                <i class="menu-icon mdi mdi-sticker"></i>
                <span class="menu-title">Basic UI Elements</span>
                <i class="menu-arrow"></i>
            </a>
            <div class="collapse" id="ui-basic">
                <ul class="nav flex-column sub-menu">
                    <li class="nav-item">
                        <a class="nav-link" href="pages/ui-features/buttons.html">Buttons</a>
                    </li>
                    <li class="nav-item">
                        <span><icon class="fa fa-bath"></icon></span>
                        <a class="nav-link" href="pages/ui-features/buttons.html">Buttons</a>
                    </li>
                </ul>
            </div>
        </li>

        <li class="nav-item">
            <a class="nav-link menu-page" href="###" page="/static/star_admin/pages/icons/font-awesome.html">
                <i class="menu-icon mdi mdi-sticker"></i>
                <span class="menu-title">Icons</span>
            </a>
        </li>
        <li class="nav-item">
            <a class="nav-link" data-toggle="collapse" href="#auth" aria-expanded="false" aria-controls="auth">
                <i class="menu-icon mdi mdi-restart"></i>
                <span class="menu-title">User Pages</span>
                <i class="menu-arrow"></i>
            </a>
            <div class="collapse" id="auth">
                <ul class="nav flex-column sub-menu">
                    <li class="nav-item">
                        <a class="nav-link" href="pages/samples/blank-page.html"> Blank Page </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link menu-page" href="###" page="/static/star_admin/pages/samples/login.html"> Login </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="pages/samples/register.html"> Register </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="pages/samples/error-404.html"> 404 </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="pages/samples/error-500.html"> 500 </a>
                    </li>
                </ul>
            </div>
        </li>

        <!--permission menu end-->
    </ul>
</nav>
